using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Vod_List -  视频 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class IVodList<T> :ModelBase<VodList> where T : VodList, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.VodId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return VodId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.VodId=dy.VodId;
           this.Title=dy.Title;
           this.VodAlbum=dy.VodAlbum;
           this.UserId=dy.UserId;
           this.ImgId=dy.ImgId;
           this.SubmitTime=dy.SubmitTime;
           this.Times=dy.Times;
           this.Click=dy.Click;
           this.Author=dy.Author;
           this.Detailed=dy.Detailed;
           this.Format=dy.Format;
           this.Sno=dy.Sno;
           this.Version=dy.Version;
        } 

        #region 定义属性

     
         /// <summary>
        /// 视频ID
        /// </summary>
        private String _VodId = "";
      
        /// <summary>
        /// 视频ID
        /// </summary>
        public String VodId
        {
            get 
            {
              return   (this._VodId); 
            }

            set 
            {
                    _VodId= value;  
            }
        }
       
     
         /// <summary>
        /// 标题
        /// </summary>
        private String _Title = "";
      
        /// <summary>
        /// 标题
        /// </summary>
        public String Title
        {
            get 
            {
              return   (this._Title); 
            }

            set 
            {
                    _Title= value;  
            }
        }
       
     
         /// <summary>
        /// 所属专辑
        /// </summary>
        private String _VodAlbum = "";
      
        /// <summary>
        /// 所属专辑
        /// </summary>
        public String VodAlbum
        {
            get 
            {
              return   (this._VodAlbum); 
            }

            set 
            {
                    _VodAlbum= value;  
            }
        }
       
     
         /// <summary>
        /// 上传用户
        /// </summary>
        private String _UserId = "";
      
        /// <summary>
        /// 上传用户
        /// </summary>
        public String UserId
        {
            get 
            {
              return   (this._UserId); 
            }

            set 
            {
                    _UserId= value;  
            }
        }
       
     
         /// <summary>
        /// 视频截图ID
        /// </summary>
        private String _ImgId = "";
      
        /// <summary>
        /// 视频截图ID
        /// </summary>
        public String ImgId
        {
            get 
            {
              return   (this._ImgId); 
            }

            set 
            {
                    _ImgId= value;  
            }
        }
       
     
         /// <summary>
        /// 上传时间
        /// </summary>
        private DateTime _SubmitTime =DateTime.MinValue;
      
        /// <summary>
        /// 上传时间
        /// </summary>
        public DateTime SubmitTime
        {
            get 
            {
              return   (this._SubmitTime); 
            }

            set 
            {
                    _SubmitTime= value;  
            }
        }
       
     
         /// <summary>
        /// 时长
        /// </summary>
        private int _Times =int.MinValue;
      
        /// <summary>
        /// 时长
        /// </summary>
        public int Times
        {
            get 
            {
              return   (this._Times); 
            }

            set 
            {
                    _Times= value;  
            }
        }
       
     
         /// <summary>
        /// 点播数
        /// </summary>
        private int _Click =int.MinValue;
      
        /// <summary>
        /// 点播数
        /// </summary>
        public int Click
        {
            get 
            {
              return   (this._Click); 
            }

            set 
            {
                    _Click= value;  
            }
        }
       
     
         /// <summary>
        /// 视频作者
        /// </summary>
        private String _Author = "";
      
        /// <summary>
        /// 视频作者
        /// </summary>
        public String Author
        {
            get 
            {
              return   (this._Author); 
            }

            set 
            {
                    _Author= value;  
            }
        }
       
     
         /// <summary>
        /// 视频说明
        /// </summary>
        private String _Detailed = "";
      
        /// <summary>
        /// 视频说明
        /// </summary>
        public String Detailed
        {
            get 
            {
              return   (this._Detailed); 
            }

            set 
            {
                    _Detailed= value;  
            }
        }
       
     
         /// <summary>
        /// 视频格式
        /// </summary>
        private String _Format = "";
      
        /// <summary>
        /// 视频格式
        /// </summary>
        public String Format
        {
            get 
            {
              return   (this._Format); 
            }

            set 
            {
                    _Format= value;  
            }
        }
       
     
         /// <summary>
        /// 排序
        /// </summary>
        private int _Sno =int.MinValue;
      
        /// <summary>
        /// 排序
        /// </summary>
        public int Sno
        {
            get 
            {
              return   (this._Sno); 
            }

            set 
            {
                    _Sno= value;  
            }
        }
       
     
         
       

      #endregion 定义属性 

          protected internal override void SetValue(VodList info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["VodId"]!= DBNull.Value)
                  {
                  info.VodId=row["VodId"].ToString();
                 }
                 
                  
                  if(row["Title"]!= DBNull.Value)
                  {
                  info.Title=row["Title"].ToString();
                 }
                 
                  
                  if(row["VodAlbum"]!= DBNull.Value)
                  {
                  info.VodAlbum=row["VodAlbum"].ToString();
                 }
                 
                  
                  if(row["UserId"]!= DBNull.Value)
                  {
                  info.UserId=row["UserId"].ToString();
                 }
                 
                  
                  if(row["ImgId"]!= DBNull.Value)
                  {
                  info.ImgId=row["ImgId"].ToString();
                 }
                 
                  
                  if(row["SubmitTime"]!= DBNull.Value)
                  {
                  info.SubmitTime=Convert.ToDateTime(row["SubmitTime"]);
                 }
                 
                  
                  if(row["Times"]!= DBNull.Value)
                  {
                  info.Times=Convert.ToInt32(row["Times"]);
                 }
                 
                  
                  if(row["Click"]!= DBNull.Value)
                  {
                  info.Click=Convert.ToInt32(row["Click"]);
                 }
                 
                  
                  if(row["Author"]!= DBNull.Value)
                  {
                  info.Author=row["Author"].ToString();
                 }
                 
                  
                  if(row["Detailed"]!= DBNull.Value)
                  {
                  info.Detailed=row["Detailed"].ToString();
                 }
                 
                  
                  if(row["Format"]!= DBNull.Value)
                  {
                  info.Format=row["Format"].ToString();
                 }
                 
                  
                  if(row["Sno"]!= DBNull.Value)
                  {
                  info.Sno=Convert.ToInt32(row["Sno"]);
                 }
                 
                  
                  if(row["Version"]!= DBNull.Value)
                  {
                  info.Version=row["Version"].ToString();
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, VodList info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@VodId", DbType.String,ParameterTool.GetObj( info._VodId )); 
            
             
                cn.AddInParameter(comm, "@Title", DbType.String,ParameterTool.GetObj( info._Title )); 
            
             
                cn.AddInParameter(comm, "@VodAlbum", DbType.String,ParameterTool.GetObj( info._VodAlbum )); 
            
             
                cn.AddInParameter(comm, "@UserId", DbType.String,ParameterTool.GetObj( info._UserId )); 
            
             
                cn.AddInParameter(comm, "@ImgId", DbType.String,ParameterTool.GetObj( info._ImgId )); 
            
             
                cn.AddInParameter(comm, "@SubmitTime", DbType.DateTime,ParameterTool.GetObj( info._SubmitTime )); 
            
             
                cn.AddInParameter(comm, "@Times", DbType.Int32,ParameterTool.GetObj( info._Times )); 
            
             
                cn.AddInParameter(comm, "@Click", DbType.Int32,ParameterTool.GetObj( info._Click )); 
            
             
                cn.AddInParameter(comm, "@Author", DbType.String,ParameterTool.GetObj( info._Author )); 
            
             
                cn.AddInParameter(comm, "@Detailed", DbType.String,ParameterTool.GetObj( info._Detailed )); 
            
             
                cn.AddInParameter(comm, "@Format", DbType.String,ParameterTool.GetObj( info._Format )); 
            
             
                cn.AddInParameter(comm, "@Sno", DbType.Int32,ParameterTool.GetObj( info._Sno )); 
            
                
                cn.AddInParameter(comm,"@Version", DbType.String, Guid.NewGuid().ToString());
              

                cn.AddInParameter(comm,"@_versionOdl", DbType.String, info._Version); 
                 
        } 

    } 
} 